﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo.Framework.AccessModifier
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }

    public class PublicClass
    {
        public void PublicMethod() { }
        protected void ProtectedMethod(){}
        private void PrivateMethod() { }
        protected internal void ProtectedInternalMethod() { }
        internal void InternalMethod() { }
    }

    class InternalClass
    {
        public void PublicMethod() { }
        protected void ProtectedMethod() { }
        private void PrivateMethod() { }
        protected internal void ProtectedInternalMethod() { }
        internal void InternalMethod() { }
    }

    // Error - Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal

    //protected internal class ProtectedInternal
    //{
    //    public void PublicMethod() { }
    //    protected void ProtectedMethod() { }
    //    private void PrivateMethod() { }
    //    protected internal void ProtectedInternalMethod() { }
    //}    

    //private class PrivateClass
    //{
    //    public void PublicMethod() { }
    //    protected void ProtectedMethod() { }
    //    private void PrivateMethod() { }
    //}
}
